package com.example.keli.base.utils;

/**
 *
 * Created by liulei on 2016/6/28.
 */
public class ClickFilter {
    private static final long INTERVAL = 500L; //防止连续点击的时间间隔
    private static long lastClickTime; //上一次点击的时间

    /**
     * @return 毫秒数
     */
    public static boolean filter() {
        long time = System.currentTimeMillis();
        long timeD = time - lastClickTime;
        if (0 < timeD && timeD < INTERVAL) {
            return true;
        }
        lastClickTime = time;
        return false;
    }
}
